#ifndef QQ_VLC_API
#define QQ_VLC_API

#include <qstring.h>
#include <qobject.h>
#include <qdebug.h>

#include <vlc/vlc.h>

class QQVLCApi :public QObject
{
public:
	QQVLCApi(QObject* parent = nullptr);
	~QQVLCApi();

	void set_audio_loop(int loop = -1);

	int get_audio_loop() const;

	//this need into a range(1~100) and this volume is based on to now your current pc volume
	void set_volume(int volume);

	int get_volume() const;

	void play_audio_by_file(const QString& filename);

	void pause_audio();

	void resume_audio();

	void stop_audio();

	bool is_playing() const;
private:
	static void stop_audio_event(const libvlc_event_t* event, void* data);
private:
	int m_audio_loop;
	int m_volume;
	libvlc_instance_t* m_instance;
	libvlc_media_player_t* m_player;
	libvlc_media_t* m_media;
};
#endif // !QQ_VLC_API
